import 'package:boss/color_constant.dart';
import 'package:boss/ui/page/offersManagement/page/plusOffersMode/model/offers_mode.dart';
import 'package:boss/ui/page/offersManagement/page/plusOffersMode/page/buyGiftOffers/buy_gift_offers_page.dart';
import 'package:boss/ui/page/offersManagement/page/plusOffersMode/page/doubleOffers/double_offers_page.dart';
import 'package:boss/ui/page/offersManagement/page/plusOffersMode/page/fullOffers/full_offers_page.dart';
import 'package:boss/ui/page/offersManagement/page/plusOffersMode/page/orderDiscount/order_discount_page.dart';
import 'package:boss/ui/page/offersManagement/page/plusOffersMode/page/planOffers/plan_offers_page.dart';
import 'package:boss/ui/page/offersManagement/page/plusOffersMode/page/specialOffers/special_offers_page.dart';
import 'package:boss/ui/page/offersManagement/page/plusOffersMode/widget/plus_offers_mode_item.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class PlusOffersModeList extends StatelessWidget {
  final List<OffersMode> offersModes = [
    OffersMode(
      name: '整单折扣',
      desc: '例：全场菜8折',
      iconText: '整单',
      url: OrderDiscountPage.pageName,
      iconColor: ColorConstant.e0e3ff,
      iconTextColor: ColorConstant.f787dc4,
    ),
    OffersMode(
        name: '方案折扣',
        desc: '例：海鲜8折 菜品5折 酒水除外',
        iconText: '方案',
        url: PlanOffersPage.pageName,
        iconColor: ColorConstant.eebd5,
        iconTextColor: ColorConstant.fcf76),
    OffersMode(
        name: '满减折扣',
        desc: '例：满100减20 满200减45',
        iconText: '满减',
        url: FullOffersPage.pageName,
        iconColor: ColorConstant.adbff,
        iconTextColor: ColorConstant.b5dc9),
    OffersMode(
        name: '特价菜', desc: '例：每日特价菜', iconText: '特价', url: SpecialOffersPage.pageName, iconColor: ColorConstant.d5f2f7, iconTextColor: ColorConstant.f88bcc6),
    OffersMode(
        name: '第二份优惠', desc: '例：第二份半价', iconText: '优惠', url: DoubleOffersPage.pageName, iconColor: ColorConstant.dbe6ff, iconTextColor: ColorConstant.f396af2),
    OffersMode(
        name: '买赠优惠', desc: '例：买二赠一', iconText: '买赠', url: BuyGiftOffersPage.pageName, iconColor: ColorConstant.ffdbea, iconTextColor: ColorConstant.ff03b73),
  ];

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      padding: EdgeInsets.symmetric(
        horizontal: 30.w,
        vertical: 16.w,
      ),
      itemBuilder: (context, index) {
        var current = offersModes[index];
        return PlusOffersModeItem(
          data: current,
          onTap: () {
            Navigator.popAndPushNamed(context, current.url);
          },
        );
      },
      itemCount: offersModes.length,
    );
  }
}
